import 'package:json_annotation/json_annotation.dart';
import 'package:gzmall_app/model/product.dart';

part 'brand.g.dart';

@JsonSerializable()
class Brand extends Object {
  @JsonKey(name: 'id')
  int id;

  @JsonKey(name: 'name')
  String name;

  @JsonKey(name: 'avatar')
  String avatar;

  @JsonKey(name: 'intro')
  String intro;

  @JsonKey(name: 'favorited')
  bool favorited;

  @JsonKey(name: 'big_avatar')
  String bigAvatar;

  @JsonKey(name: 'spus')
  List<Product> spus;

  @JsonKey(name: 'share_title')
  String shareTitle;

  @JsonKey(name: 'share_content')
  String shareContent;

  @JsonKey(name: 'share_avatar')
  String shareAvatar;

  @JsonKey(name: 'share_url')
  String shareUrl;

  Brand(
    this.id,
    this.name,
    this.intro,
    this.favorited,
    this.bigAvatar,
    this.spus,
    this.shareTitle,
    this.shareContent,
    this.shareAvatar,
    this.shareUrl,
  );

  factory Brand.fromJson(Map<String, dynamic> srcJson) =>
      _$BrandFromJson(srcJson);
}
